package com.example.shop.order.enums;

/**
 * 订单状态
 */
public enum OrderState {
    STAY_PAY(0,"待付款"),
    CANCEL_ORDER(1,"取消订单"),
    STAY_DELIVERY(2,"待发货"),
    DUE_IN_GOODS(3,"待收货"),
    STAY_EVALUATE(4,"待评价"),
    ALREADY_EVALUATE(5,"已评价");
    private Integer orderState;
    private String stateDesc;
    OrderState(Integer orderState,String stateDesc){
        this.orderState = orderState;
        this.stateDesc = stateDesc;
    }
    public static OrderState getOrderState(Integer orderState){
        switch (orderState){
            case 1: return CANCEL_ORDER;
            case 2: return STAY_DELIVERY;
            case 3: return DUE_IN_GOODS;
            case 4: return STAY_EVALUATE;
            case 5: return ALREADY_EVALUATE;
            default: return STAY_PAY;
        }
    }

    public Integer getOrderState() {
        return orderState;
    }

    public String getStateDesc() {
        return stateDesc;
    }
}
